package presenter;

import java.io.File;
import java.util.ArrayList;

/**
 *
 * @author Al
 */
public class BibleInformation {
    static ArrayList<Bible> bibles=new ArrayList<Bible>();
    static String defaultBible="NIV";
    
    static Bible getDefaultBible() {
        return getBible(defaultBible);
    }
    
    static Bible getBible(String name) {
        
        if(name.contains(".xmm")) {
            name=name.substring(0,name.indexOf(".xmm"));
        }
        System.out.println(name);
        for(int i=0; i<bibles.size(); i++) {
            if(name.equals(bibles.get(i).name)) {
                return bibles.get(i);
            }
        }
        Bible bib=new Bible(new File("Bibles/"+name+".xmm"),name+".xmm");
        if(bib.getBook("Exodus")!=null)
            bibles.add(bib);
        
        return bib;
    }
}
